import styled from 'styled-components';
import logo from '../../static/logo.png'

const HeaderWrap = styled.div`
    height: 56px;
    line-height: 56px;
    //background-color: red;
`;

const Logo = styled.span`
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100px
    height: 56px;
    background-image: url(${logo});
    background-size: contain;
`;

const Nav = styled.nav`
    color: #333;
    width: 960px;
    padding-right: 40px;
    box-sizing: border-box;
    height: 56px;
    //background-color: green;
    margin: 0 auto;
`;

const NavItem = styled.div`
    &.left{
        float: left
    }
    &.right{
        float: right;
        color: #969696;
        fone-size: 15px;
    }
    &.active{
        color: rgb(234, 111, 90);
    }
    cursor: pointer;
    padding: 15px;
    box-size: border-box;
    height: 26px
    line-height: 26px
`;


// 传递attrs。里面为一个对象。。。。
/*  &.focused: 说明此处class和外部的组件为同级关系
*  &::placeholder{
        color: #a7a0a0
    }
* */
const SearchInput = styled.input.attrs({
    placeholder: '搜索'
})`
    width: 160px;
    height: 38px;
    font-size: 14px;
    margin-left: 15px;
    color: #666;
    border-radius: 18px;
    background-color: #eee;
    border: none;
    padding: 0 38px 0 20px;
    outline: none;
    &::placeholder{
        color: #a7a0a0
    }
    &.focused{
      width: 240px;
      transition: all .4s ease-out
    }
    transition: all .4s ease-out
`;


const Button = styled.div`
  &.register{
        border: 1px solid #ea6f5a;
        color: #ea6f5a;
    }
    &.write{
        background-color: #ea6f5a;
        color: #fff;
    }
    height: 38px;
    line-height: 26px
    font-size: 15px
    box-sizing: border-box;
    float: right;
    margin: 9px 20px 9px 0
    padding: 5px 25px
    border-radius: 19px
    .iconfont{
      padding-left: 5px;
    }
    
`;

const Addition = styled.div`
    position: absolute;
    top: 0;
    right: 0;
`;

const SearchWrapper = styled.div`
  position: relative;
  float: left;
  .zoom{
    position: absolute;
    top: 15px;
    right: 5px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    &.focused{
      background: #777;
      color: #fff
    }  
  }
`;

const SearchInfo = styled.div`
  z-index: 2;
  transition: all .5px ease-out
  background: #fff;
  position: absolute;
  left: 0;
  width: 330px;
  box-shadow: 0 0 8px rgba(0,0,0,.2);
  top: 56px;
  padding: 20px 20px 10px 20px;
  box-sizing: border-box;
`;
const SearchTitle = styled.div`
  line-height: 20px
  .spin{
    display: inline-block;
    color: #656;
    margin-right: 3px;
    font-size: 12px
    transition: all .4s ease-in;
    transition-origin: center center
  }
`;

const SearchTop = styled.span`
  font-size: 14px;
`;
const SearchSwitch = styled.span`
  font-size: 13px;
  float: right;
  cursor: pointer;
`;

const SearchContent = styled.div`
  margin-top: 20px
`;
const SearchItem = styled.a`
  font-size: 12px;
  padding:  2px 8px;
  cursor: pointer;
  border: 1px solid #ccc;
  color: #787878;
  border-radius: 3px
  line-height: 20px
  margin: 0 15px 10px 0;
  float: left;
`;


export { HeaderWrap, Logo, Nav, NavItem,Button,
  Addition, SearchInput, SearchWrapper, SearchInfo,
  SearchTitle, SearchTop, SearchSwitch, SearchContent,
  SearchItem
};